home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
B-Business
/
(c)b3.d64
/
jogger.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2008-11-26
|
8KB
|
298 lines
1 GOSUB10000
11 DIM DE(11,6)
12 FORI=0TO10
13 DE(I,0)=CAL(I)
14 DE(I,1)=TME(I)
15 DE(I,2)=DIS(I)
16 DE(I,3)=STD(I)
17 DE(I,4)= MH(I)
18 DE(I,5)= MM(I)
19 NEXT
20 I=0
25 PRINT"[147]"
26 PRINT
27 PRINTTAB(5)"FUNCTIONS (SELECT A NUMBER)"
28 PRINT
29 PRINT"1 READ DATA FROM TAPE"
30 PRINT"2 ENTER NEW JOGGING DATA"
31 PRINT"3 SUMMARY OF DAILY RECORDS"
32 PRINT"4 PRINT DATA TO TAPE"
33 PRINT"5 VIEW CHARTS"
34 PRINT"6 END PROGRAM"
35 INPUTA
36 IFA=1THEN44
37 IFA=2THEN220
38 IFA=3THEN500
39 IFA=4THEN800
40 IFA=5THEN2000
41 IFA=6THEN7000
44 REM READ FROM TAPE
45 PRINT"[147]**READ JOGGING DATA FROM TAPE**":PRINT
50 PRINT"**MOUNT TAPE**":PRINT
55 PRINT"**PRESS <RETURN> WHEN READY**":PRINT
60 GETA$:IFA$=""THEN60
65 PRINT"**OPENING DATA FILE**":OPEN1,1,0,"JOGGER":PRINT
68 INPUT#1,I:PRINT"INDEX IS "I
70 FORX=1TOI
75 INPUT#1,CAL$(X):PRINT"DATE :"CAL$(X)
77 INPUT#1,T(X):PRINT"TIME :"T(X)
79 INPUT#1,D(X):PRINT"DISTANCE:"D(X)
81 INPUT#1,S(X):PRINT"STRIDES :"S(X)
83 INPUT#1,MH(X):PRINT"MILES/HR:"MH(X)
85 INPUT#1,MM(X):PRINT"MIN/MILE:"MM(X)
90 NEXT
91 PRINT"**CLOSING DATA FILE**":CLOSE1
105 PRINT"PRESS <RETURN> WHEN READY TO PROCEED"
106 GETA$:IFA$=""THEN106
107 GOTO25
220 POKE53281,5:PRINTCHR$(144):PRINT"[147]ENTER JOGGING DATA"
225 I=I+1
228 PRINT" "CHR$(18)"0"CHR$(146)" DATE:"
230 PRINT" "CHR$(18)"1"CHR$(146)" TIME(MIN):"
240 PRINT" "CHR$(18)"2"CHR$(146)" DISTANCE:"
250 PRINT" "CHR$(18)"3"CHR$(146)" STRIDES:"
260 PRINT" "CHR$(18)"4"CHR$(146)" MILES/HR:"
270 PRINT" "CHR$(18)"5"CHR$(146)" MIN/MILE:"
280 IN%=5
290 PRINT"";TAB(13);
295 GOSUB8000:CAL$(I)=CC$
298 PRINTCHR$(13);TAB(13)
300 GOSUB8000:TME$(I)=CC$
310 PRINTCHR$(13);TAB(13)
320 GOSUB8000:DIS$(I)=CC$
330 PRINTCHR$(13);TAB(13)
340 GOSUB8000:STD$(I)=CC$
350 T(I)=VAL(TME$(I)):D(I)=VAL(DIS$(I)):S(I)=VAL(STD$(I))
360 MH(I)=D(I)/(T(I)/60):MM(I)=T(I)/D(I)
370 PRINTCHR$(13)TAB(13);MH(I);"[157][157][157][157][157][157][157][157]";TAB(18)" "
380 PRINTTAB(13);MM(I);"[157][157][157][157][157][157][157][157]";TAB(18)" "
390 PRINT"DO YOU WANT TO ENTER MORE DATA (Y/N)":INPUTA$
395 IFA$="Y"THEN220
400 FORX=1TOI:PRINTCHR$(13)
405 PRINT" DATE: "CAL$(X)
406 PRINT" [163][163][163][163][163]"
410 PRINT" TIME: "T(X)
420 PRINT" DISTANCE:"D(X)"[157][157][157][157][157][157][157][157]"TAB(15)" "
430 PRINT" STRIDES: "S(X)
440 PRINT" MILES/HR:"MH(X)"[157][157][157][157][157][157][157][157]"TAB(15)" "
450 PRINT" MIN/MILE:"MM(X)"[157][157][157][157][157][157][157][157]"TAB(15)" "
455 IFX=2ORX=4ORX=6ORX=8ORX=10THENGOTO7010
460 NEXT
465 PRINT
466 PRINT
467 PRINT"PRESS <RETURN> WHEN READY"
468 GETA$:IFA$=""THEN468
469 GOTO25
500 TS=0:SD=0:SS=0:SH=0:SM=0
510 FORX=1TOI
515 TS=TS+T(X):SD=SD+D(X):SS=SS+S(X):SH=SH+MH(X):SM=SM+MM(X)
520 NEXT
530 TS=TS/I:SD=SD/I:SS=SS/I:SH=SH/I:SM=SM/I
540 PRINT"ENTER 'MONTH' OF SUMMARY'":INPUTB$
550 PRINT"[147]"TAB(12);B$
555 PRINTTAB(10)"SUMMARY"
560 PRINT"[163][163][163][163][163][163][163]"
570 PRINT"TIME :";TS;"[157][157][157][157][157][157][157][157][157][157]"TAB(14)" "
575 PRINT"DISTANCE:";SD;"[157][157][157][157][157][157][157][157][157][157]"TAB(14)" "
580 PRINT"STRIDES :";SS;"[157][157][157][157][157][157][157][157][157][157]"TAB(14)" "
585 PRINT"MILES/HR:";SH;"[157][157][157][157][157][157][157][157][157][157]"TAB(14)" "
590 PRINT"MIN/MILE:";SM;"[157][157][157][157][157][157][157][157][157][157]"TAB(14)" "
595 PRINT
596 PRINT
597 PRINT"PRESS <RETURN> WHEN READY"
598 GETA$:IFA$=""THEN598
599 GOTO25
800 REM PRINT DETAIL DATA TO TAPE
805 PRINT"[147]**CREATE DATA FILE**:?
810 [153]" **MOUNT TAPE**"
815 [153]" **PRESS <RETURN> WHEN READY**":[153]
820 [161]A$:[139]A$[178]""[167]820
825 [153]" **OPENING DATA FILE**":[159]1,1,1,"JOGGER":[153]
828 [152]1,I
830 [129]X[178]1[164]I
835 [152]1,CAL$(X)
840 [152]1,T(X)
845 [152]1,D(X)
850 [152]1,S(X)
855 [152]1,MH(X)
860 [152]1,MM(X)
865 [130]
870 [160]1
875 [153]
876 [153]
877 [153]"PRESS <RETURN> WHEN READY"
878 [161]A$:[139]A$[178]""[167]878
879 [137]25
2000 [143] DEVELOP CHARTS
2040 [153]"LOADCHARTS (SELECT A NUMBER)"
2045 [153]"1. TIME"
2046 [153]"2. DISTANCE"
2047 [153]"3. STRIDES"
2048 [153]"4. MILES/HR"
2049 [153]"5. MIN/MILE"
2050 [153]"6. LIST FUNCTIONS"
2051 [153]"7. END PROGRAM"
2052 [161]A$:[139]A$[178]""[167]2052
2055 [139]A$[178]"1"[167]2080
2056 [139]A$[178]"2"[167]2500
2057 [139]A$[178]"3"[167]3000
2058 [139]A$[178]"4"[167]3500
2059 [139]A$[178]"5"[167]4000
2060 [139]A$[178]"6"[167]25
2061 [139]A$[178]"7"[167]7000
2080 [151]53281,13:[151]53280,9:[153][199](144)
2085 [153]"LOAD"[163]12)"TIME IN MINUTES"
2090 [141]9090
2120 [153]""[163]2)"48"[163]36)"48"
2125 [153]""[163]2)"46"[163]36)"46"
2130 [153]""[163]2)"44"[163]36)"44"
2135 [153]""[163]2)"42"[163]36)"42"
2140 [153]""[163]2)"40"[163]36)"40"
2141 P[178]7:[129]X[178]1[164]I:[153][163]P[171]1)[200](CAL$(X),3);:P[178]P[170]5:[130]
2142 [153][199](13)"ON":P[178]7:[129]X[178]1[164]I:[153][163]P)[201](CAL$(X),2);:P[178]P[170]5:[130]
2143 [153][199](13):[153] "PRESS <RETURN> FOR NEW SELECTION"
2144 P[178]7
2145 [129]X[178]1[164]I
2150 [139]T(X)[179][181](T(X))[170].3[167]T(X)[178][181](T(X))
2155 [139]T(X)[177][181](T(X))[170].3[175]T(X)[179][181](T(X))[170].7[167]T(X)[178][181](T(X))[170].5
2160 [139]T(X)[177][181](T(X))[170].7[167]T(X)[178][181](T(X))[170]1
2175 [129]T[178]1784[170]P[164](1784[170]P)[171](T(X)[171]40)[172]80[169][171]40:[151]T,160:[130]
2180 [129]T[178]56056[170]P[164](56056[170]P)[171](T(X)[171]40)[172]80[169][171]40:[151]T,6:[130]
2185 P[178]P[170]5
2190 [130]
2200 [161]A$:[139]A$[178]""[167]2200
2201 [137]2040
2500 [151]53281,14:[151]53280,5:[153][199](144)
2505 [153]"LOAD"[163]12)"DISTANCE IN MILES"
2510 [141]9090
2515 [153]""[163]1)"6.0"[163]36)"6.0"
2520 [153]""[163]1)"5.5"[163]36)"5.5"
2525 [153]""[163]1)"5.0"[163]36)"5.0"
2530 [153]""[163]1)"4.5"[163]36)"4.5"
2535 [153]""[163]1)"4.0"[163]36)"4.0"
2540 P[178]7:[129]X[178]1[164]I:[153][163]P[171]1)[200](CAL$(X),3);:P[178]P[170]5:[130]
2545 [153][199](13)"ON":P[178]7:[129]X[178]1[164]I:[153][163]P)[201](CAL$(X),2);:P[178]P[170]5:[130]
2550 [153][199](13):[153] "PRESS <RETURN> FOR NEW SELECTION"
2555 P[178]7
2560 [129]X[178]1[164]I
2580 [129]T[178]1784[170]P[164](1784[170]P)[171](D(X)[171]4.0)[172]320[169][171]40:[151]T,160:[130]
2585 [129]T[178]56056[170]P[164](56056[170]P)[171](D(X)[171]4.0)[172]320[169][171]40:[151]T,7:[130]
2590 P[178]P[170]5
2595 [130]
2600 [161]A$:[139]A$[178]""[167]2600
2605 [137]2040
3000 [151]53281,11:[151]53280,7:[153][199](144)
3010 [153]"LOAD"[163]11)"NUMBER OF STRIDES(K)"
3020 [141]9090
3025 [153]""[163]1)"8.0"[163]36)"8.0"
3030 [153]""[163]1)"7.5"[163]36)"7.5"
3035 [153]""[163]1)"7.0"[163]36)"7.0"
3040 [153]""[163]1)"6.5"[163]36)"6.5"
3045 [153]""[163]1)"6.0"[163]36)"6.0"
3050 P[178]7:[129]X[178]1[164]I:[153][163]P[171]1)[200](CAL$(X),3);:P[178]P[170]5:[130]
3055 [153][199](13)"ON":P[178]7:[129]X[178]1[164]I:[153][163]P)[201](CAL$(X),2);:P[178]P[170]5:[130]
3060 [153][199](13):[153] "PRESS <RETURN> FOR NEW SELECTION"
3065 P[178]7
3070 [129]X[178]1[164]I
3075 [129]T[178]1784[170]P[164](1784[170]P)[171](S(X)[173]1000[171]6.0)[172]320[169][171]40:[151]T,160:[130]T
3085 [129]T[178]56056[170]P[164](56056[170]P)[171](S(X)[173]1000[171]6.0)[172]320[169][171]40:[151]T,5:[130]T
3090 P[178]P[170]5
3095 [130]X
3100 [161]A$:[139]A$[178]""[167]3100
3105 [137]2040
3500 [151]53281,7:[151]53280,6:[153][199](144)
3505 [153]"LOAD"[163]13)"MILES PER HOUR"
3510 [141]9090
3515 [153]""[163]1)"7.5"[163]36)"7.5"
3520 [153]""[163]1)"7.0"[163]36)"7.0"
3525 [153]""[163]1)"6.5"[163]36)"6.5"
3530 [153]""[163]1)"6.0"[163]36)"6.0"
3535 [153]""[163]1)"5.5"[163]36)"5.5"
3540 P[178]7:[129]X[178]1[164]I:[153][163]P[171]1)[200](CAL$(X),3);:P[178]P[170]5:[130]
3545 [153][199](13)"ON":P[178]7:[129]X[178]1[164]I:[153][163]P)[201](CAL$(X),2);:P[178]P[170]5:[130]
3550 [153][199](13):[153] "PRESS <RETURN> FOR NEW SELECTION"
3555 P[178]7
3560 [129]X[178]1[164]I
3580 [129]T[178]1784[170]P[164](1784[170]P)[171](MH(X)[171]5.5)[172]320[169][171]40:[151]T,160:[130]
3585 [129]T[178]56056[170]P[164](56056[170]P)[171](MH(X)[171]5.5)[172]320[169][171]40:[151]T,3:[130]
3590 P[178]P[170]5
3595 [130]
3600 [161]A$:[139]A$[178]""[167]3600
3605 [137]2040
4000 [151]53281,10:[151]53280,15:[153][199](144)
4010 [153]"LOAD"[163]12)"MINUTES PER MILE"
4020 [141]9090
4025 [153]""[163]1)"9.5"[163]36)"9.5"
4030 [153]""[163]1)"9.0"[163]36)"9.0"
4035 [153]""[163]1)"8.5"[163]36)"8.5"
4040 [153]""[163]1)"8.0"[163]36)"8.0"
4045 [153]""[163]1)"7.5"[163]36)"7.5"
4050 P[178]7:[129]X[178]1[164]I:[153][163]P[171]1)[200](CAL$(X),3);:P[178]P[170]5:[130]
4055 [153][199](13)"ON":P[178]7:[129]X[178]1[164]I:[153][163]P)[201](CAL$(X),2);:P[178]P[170]5:[130]
4060 [153][199](13):[153] "PRESS <RETURN> FOR NEW SELECTION"
4065 P[178]7
4070 [129]X[178]1[164]I
4075 [129]T[178]1784[170]P[164](1784[170]P)[171](MM(X)[171]7.5)[172]320[169][171]40:[151]T,160:[130]T
4085 [129]T[178]56056[170]P[164](56056[170]P)[171](MM(X)[171]7.5)[172]320[169][171]40:[151]T,4:[130]T
4090 P[178]P[170]5
4095 [130]X
4100 [161]A$:[139]A$[178]""[167]4100
4105 [137]2040
7000 [128]
7010 [153]"WHEN READY TO SEE NEXT SET OF DATA PRESS 'Y'":[133]A$
7020 [139]A$[178]"Y"[167]460
7030 [137]7000
8000 ST%[178][185](X)
8010 [153]"";
8020 [129]A[178]1[164]IN%:[153]" ";:[130]
8030 [153]"WAIT";[199](13);"ON";[163]ST%)
8040 CC$[178]"":J%[178]0
8050 [129]A[178]1[164]IN%
8060 :J%[178]J%[170]1
8070 :[161]C$:[139]C$[178]""[167]8070
8080 :[139]C$[178]"_"[167][153][199](13)[199](145)[163]ST%):[137]8010
8090 :[139]C$[178][199](13)[167]8120
8100 :[153]C$;:CC$[178]CC$[170]C$
8110 [130]
8120 [139]J%[178]IN%[167]8160
8130 [129]A[178]J%[164]IN%
8140 :CC$[178]CC$[170]" "
8150 [130]
8160 [153][199](13);"ON";[163]ST%);CC$;
8170 [142]
9090 [129]J[178]1068[164]1099:[151]J,99:[130]
9100 [129]J[178]55340[164]55371:[151]J,1:[130]
9110 [129]J[178]1829[164]1858:[151]J,99:[130]
9111 [129]J[178]56101[164]56130:[151]J,1:[130]
9112 [129]J[178]1068[164]1788[169]40:[151]J,103:[130]
9113 [129]J[178]55340[164]56060[169]40:[151]J,1:[130]
9114 [129]J[178]1099[164]1819[169]40:[151]J,101:[130]
9115 [129]J[178]55371[164]56091[169]40:[151]J,1:[130]
9116 [142]
10000 [153]"LOAD":[151]53281,1:[151]53280,15:[153][199](144)
10010 [153][163]9)"JOGGER - 4 TO 6 MILES
10015 PRINTTAB(12)"BY SID HOROVITZ"
10020 PRINT""TAB(3)"'JOGGER' KEEPS A RECORD OF YOUR DATA ";
10030 PRINT"FROM RUNNING 4 TO 6 MILES. USE THE ";
10040 PRINT"DIS- PLAY CHARTS AS WELL AS PERMANENT ";
10050 PRINT"STORAGEFACILITY ON TAPE FOR FILE ";
10060 PRINT"LENGTHS UP TO 6 ITEMS (JOGS). FOR DISK ";
10070 PRINT"OPERATION, CHANGE SUBROUTINES AT LINES ";
10080 PRINT"44 AND 800."
10190 PRINT"PRESS <RETURN> WHEN READY
10195 [161]A$:[139]A$[178]""[167]10195
10200 [153]"LOAD"[163]12)"INSTRUCTIONS"
10210 [153]"TO ENTER NEW DATA (MAX. 5 DIGITS EACH)"
10220 [153]" 'DATE': MONTH-3 DIGITS, DAY-2 DIGITS"
10230 [153]" 'TIME': NUMBER OF MINUTES TO 2 DECIMALS"
10240 [153]" 'DISTANCE': NUMBER OF MILES TO 3 DECIMALS"
10250 [153]" 'STRIDES': NUMBER OF STRIDES TAKEN."
10255 [153]" THIS IS OPTIONAL"
10260 [153]"YOUR PERFORMANCE WILL BE DISPLAYED IN:"
10270 [153]" MILES PER HOUR"
10280 [153]" MINUTES PER MILE"
10290 [153]"PRESS '_' TO CORRECT DATA ON ANY LINE"
10480 [153]"PRESS <RETURN> WHEN READY"
10490 [161]A$:[139]A$[178]""[167]10490
10500 [142]